<template>
  <div>
      {{data}}
  </div>
</template>

<script>
import axios from 'axios'
export default {
 data(){
     return{
         data:'',
         url:'https://api.apiopen.top/getJoke?page=1&count=2&type=video'
     }
 },
 mounted: function(){
  let httpUrl = this.$data.url
    this.getData( httpUrl);

 },
 methods:{
     getData: function(url){
         axios.get(url)
         .then(res=>{
             console.log(res.data.result);
            this.$data.data= res.data.result 
             console.log(this.$data.data);
                
         })
         .catch(err=>{
             console.log(err);
         })
     }
 }

}
</script>

<style>

</style>
